package com.lambda.hybrid;

import com.lambda.hybrid.utils.Const;

import java.util.Locale;

/**
 * Created by micr on 2017/12/28 0028.
 */

class BridgeHelper {
    @SuppressWarnings("unused")
    private final String TAG = "BridgeHelper";

    static String err(String data) {
        return String.format(Locale.CHINA, "javascript:$%s.err('%s')", Const.HYBRID_SCHEME, data);
    }

    static String invoke(String name, String data, int cbid) {
        return String.format(Locale.CHINA, "javascript:$%s.invoke('%s', '%s', %d)", Const.HYBRID_SCHEME, name, data, cbid);
    }

    static String callback(int cbid, String data) {
        return String.format(Locale.CHINA, "javascript:$%s.callback(%d, '%s')", Const.HYBRID_SCHEME, cbid, data);
    }
}
